/*
	File:		RangedWeapon.h
	Author:		Ben Feldmann
	Purpose:	Base Class for ranged weapons
*/

#pragma once

#include "Entity.h"
#include "Player.h"
#include "Emitter.h"

class Player;
class Projectile;
class Player;

enum RangedWeapons	{RW_BASE, RW_ROCKET, RW_EMP, RW_FLAME};


class RangedWeapon : public Entity 
{
protected:
	float cooldownTimer;
	float shotTimer;
	float cooldownSeconds;
	float ROF;
	bool attackReady;
	bool specialReady;
	float energyCost;
	int priceScrap;
	int priceCircuit;
	Projectile* bullet;
	Player* player;

	Emitter* emitter;

public:
	RangedWeapon() { player = nullptr; }
	~RangedWeapon() { /*(player) ? player->Release():0;*/ }

	virtual bool CheckCollision(IEntity* base);

	virtual void Attack();

	virtual void SpecialAttack();

	virtual void Render();

	virtual void Update(float elapsed);

	bool	isAttackReady()			{return attackReady;}
	bool	isSpecialReady()		{return specialReady;}

	float	GetCoolTimer() const	{return cooldownTimer;}
	void	SetCoolTimer(float t)	{cooldownTimer = t;}

	float	GetCoolSeconds() const	{return cooldownSeconds;}
	void	SetCoolSeconds(float s)	{cooldownSeconds = s;}

	float	GetROF() const			{return ROF;}
	void	SetROF(float r)			{ROF = r;}

	float	GetEnergyCost() const	{return energyCost;}
	void	SetEnergyCost(float e)	{energyCost = e;}

	int		GetMetalPrice() const	{return priceScrap;}
	void	SetMetalPrice(int p)	{priceScrap = p;}

	int		GetCircuitPrice() const	{return priceCircuit;}
	void	SetCircuitPrice(int c)	{priceCircuit = c;}

	Player* GetOwner() const		{return player;}
	void	SetOwner(Player* o)		{(player) ? player->Release():0;player = o;}//(player)?o->AddRef():0;}

	int		GetRangeType() const	{return rangedType;}

protected:
	int rangedType;
};
